package com.code.backgrounddemo

import android.app.Activity
import android.app.Application
import android.os.Bundle
import com.code.background.BackgroundLibrary

/**
 * Created by RLZ
 * on 2021/12/21
 *
 */
class App : Application() {

    override fun onCreate() {
        super.onCreate()



        registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
            override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
                BackgroundLibrary.inject(activity)
            }

            override fun onActivityStarted(activity: Activity) {
            }

            override fun onActivityResumed(activity: Activity) {
            }

            override fun onActivityPaused(activity: Activity) {
            }

            override fun onActivityStopped(activity: Activity) {
            }

            override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
            }

            override fun onActivityDestroyed(activity: Activity) {
            }

        })
    }
}